#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <Window.h>
#include <Button.h>
#include <TextControl.h>
#include <Path.h>
#include <TextView.h>
#include <ScrollView.h>
#include <FilePanel.h>

enum
{
    MSG_GENERATE = 'GEN ',
    MSG_APPEND = 'APPD',
    MSG_TEXT_MODIFIED = 'TXTM',
    MSG_CONVERT_SCEL = 'SCEL',
    MSG_BROWSE_SCEL = 'BRWS',
    MSG_REFS_RECEIVED = 'REFS'
};

class MainWindow : public BWindow
{
public:
    MainWindow();
    virtual ~MainWindow();
    virtual bool QuitRequested();
    virtual void MessageReceived(BMessage *message);

private:
    void _InitInterface();
    void _GenerateCinFile();
    void _AppendToCinFile();
    void _AutoGeneratePinyin();
    void _ConvertScelFile();
    void _BrowseScelFile();

    BTextControl *fOutputPathControl;
    BTextControl *fScelPathControl;
    BTextControl *fChineseInput;
    BTextControl *fPinyinInput;
    BTextView *fPreviewText;
    BScrollView *fPreviewScroll;
    BButton *fGenerateButton;
    BButton *fAppendButton;
    BButton *fBrowseScelButton;
    BButton *fConvertScelButton;
    BFilePanel *fFilePanel;
};

#endif // MAINWINDOW_H